//
//  ViewController.m
//  ZWKPicLoop
//
//  Created by MS on 15/11/19.
//
//

#import "ViewController.h"
#import "ZWKHeaderView.h"
#import "Masonry.h"
@interface ViewController ()<ZWKHeaderViewDelegate>
@property (nonatomic,strong) NSMutableArray * imageNames;
@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    ZWKHeaderView * headerView = [ZWKHeaderView headView];
    headerView.delegate = self;
    [self.view addSubview:headerView];
    [headerView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.height.equalTo(@(200));
        make.left.equalTo(self.view.mas_left);
        make.right.equalTo(self.view.mas_right);
        make.top.equalTo(self.view.mas_top);
    }];
    [self.view layoutIfNeeded];
    headerView.timerInterval = 1.0f;
    headerView.fireSeconds = 1.0f;
    headerView.imageNames = self.imageNames;
    
}
#pragma mark ZWKHeaderViewDelegate
- (void)headerViewDidSelected:(ZWKHeaderView *)headerView atIndex:(NSInteger)index{
    NSLog(@"%ld",index);
}
- (NSMutableArray *)imageNames{
    if(_imageNames == nil){
       self.imageNames = [[NSMutableArray alloc]init];
        for (int i = 1;i<=15; i++) {
            [_imageNames addObject:[NSString stringWithFormat:@"%d.jpg",i]];
        }
    }
    return _imageNames;
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
